package com.smartplatform.mapper;

import com.smartplatform.pojo.SysCategory;
import org.apache.ibatis.annotations.*;

import java.util.Date;
import java.util.List;

/**
 * @Author 咕唧
 * @Date 2022/5/30 16:04
 * @Version 1.0
 */
public interface SysCategoryMapper {
    @Insert("insert into sys_category (category_name,tx_command,rx_command,command_name,create_time,create_by)" +
            " values (#{categoryName},#{txCommand},#{rxCommand},#{commandName},#{createTime},#{createBy})")
    void addSysCategory(SysCategory sysCategory);

    @Select("select * from sys_category")
    List<SysCategory> findAll();

    @Delete("update  sys_category set status = 0 ,update_time = #{date},update_by=#{username}  where c_id=#{cId}")
    void deleteById(@Param("cId") Long cId,@Param("date") Date date,@Param("username") String username);

    void deleteByIds(@Param("ids") List<Long> ids, @Param("updateTime") Date updateTime, @Param("username") String username, @Param("status") Long status);
}
